import React from 'react'
import store from '../../store/store'
import { getMovieAction } from "../../store/actions/movieAction";


export default function Movie() {
    // 获取count数据
    const {count}=store.getState().count
    // 获取movieList数据
    const {movieList}=store.getState().movie
    // 获取电影数据的事件函数
    const getMovieList=()=>{
        store.dispatch(getMovieAction())
    }
  return (
    <div>
        <h1>我是Movie组件</h1>
        <h2>我拿到的Count组件的值是{count}</h2>
        <button onClick={getMovieList}>获取电影的数据</button>
        <ul>
            {
                movieList.map(item=>{
                    return <li key={item.tvId}>{item.albumName}</li>
                })
            }
        </ul>
    </div>
  )
}
